<?php
use yii\helpers\Html;

$cid = Yii::$app->request->get('cid', $defaultCid);
$this->title = "快讯";
?>
<div class="page-banner page-banner-news">
    <h1><?=Html::decode($this->title)?></h1>
</div>
<!--/page-banner-->
<ul class="box-main page-nav">
    <li><a href="<?=Yii::$app->homeUrl?>"><?=Yii::$app->name?></a></li>
    <li><span><?=Html::decode($this->title)?></span></li>
</ul>
<!--/page-nav-->
<div class="box-main box-white clearfix">
    <ul class="tabs-blue">
        <?php foreach ($postCate as $cate): ?>
        <li <?php if ($cid==$cate['id']){ echo 'class="active"'; } ?>>
            <a href="<?=Yii::$app->urlManager->createUrl(['post/index', 'cid'=>$cate['id']])?>"><?=$cate['name']?></a>
        </li>
        <?php endforeach; ?>
    </ul>
    <!--/tabs-blue-->
    <div class="news-page pa-15">
        <?php
        echo \yii\widgets\ListView::widget([
            'dataProvider' => $dataProvider,
            'options' => [
                'tag' => 'div',
                'class' => 'news-list row'
            ],
            'layout' => '{items}',
            'itemOptions' => [
                'tag' => 'div',
                'class' => 'item col-xs-12 col-md-3'
            ],
            'itemView' => '_item',
            'emptyText' => '<div class="no-record"><figure><img src="/uploads/no-record.png" alt=""></figure><h3>Ooops !</h3><p>未找到该产品，试试别的关键字？</p></div>',

//        'pager' => [
//            //'options'=>['class'=>'hidden']//关闭分页
//            'firstPageLabel' => "First",
//            'prevPageLabel' => 'Prev',
//            'nextPageLabel' => 'Next',
//            'lastPageLabel' => 'Last',
//        ]
        ]);

        echo \app\core\lib\GLinkPager::widget([
            'pagination' => $dataProvider->pagination,
            'options' => ['class' => 'pagination'],
            'maxButtonCount'=>10,
            'nextPageLabel'=>Yii::t('app','下一页'),
            'prevPageLabel'=>Yii::t('app','上一页'),
            'firstPageLabel' => '首页',
            'lastPageLabel' => '尾页'
        ]);
        ?>
    </div>
    <!--/news-page-->
</div>
<!--/box-main-->